package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.util.UploadUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


/**
 * 上传图片
 */
@RestController
public class UploadImgController {

    /**
     * 普通图片上传
     * @param pic
     * @return
     * @throws Exception
     */
    @PostMapping ("/coverImageUpload")
    public Object uploadImg(MultipartFile pic) throws Exception {
        //调用工具方法
        String file = UploadUtil.uploadAli(pic);

        return file;
    }

}
